<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:comps="http://java.sun.com/jsf/composite/components">


	<h:panelGrid columns="2" columnClasses="topAlign, topAlign">
		<p:panel header="#{locale['blog.post.titulo']}">

			<h:form id="listagemDashboardPostForm">
				<p:dataTable id="registros" var="registro"
					styleClass="dataTableListagem" widgetVar="dashboardPostTable"
					value="#{UsuarioDashboardBean.posts}" paginator="true" rows="12"
					paginatorPosition="bottom" paginatorAlwaysVisible="true"
					tableStyleClass="tableListagem"
					emptyMessage="#{locale['crud.pesquisa.lista.semResultado']}">

					<p:column sortBy="#{registro.titulo}">

						<f:facet name="header">
							<h:outputText style="padding: 0px 10px 0px 10px;"
								value="#{locale['blog.label.titulo']}" />
						</f:facet>
						<h:panelGroup layout="block" style=" width: 150px;">
							<h:outputText value="#{registro.titulo}" />
						</h:panelGroup>

					</p:column>

					<p:column sortBy="#{registro.conteudo}">

						<f:facet name="header">
							<h:outputText
								value="#{locale['blog.pesquisa.label.conteudo']} (resumo)" />
						</f:facet>
						<h:panelGroup layout="block" style=" width: 600px;">
							<h:outputText value="#{registro.conteudo}" escape="false">
								<f:converter converterId="converter.StringTruncateConverter" />
								<f:attribute name="truncateLimit" value="200" />
							</h:outputText>
						</h:panelGroup>

					</p:column>

				</p:dataTable>

			</h:form>
		</p:panel>

		<p:panel header="#{locale['blog.post.comentarios']}">

			<h:form id="listagemDashboardComentarioForm">
				<p:dataTable id="registros" var="registro"
					styleClass="dataTableListagem" widgetVar="dashboardComentarioTable"
					value="#{UsuarioDashboardBean.comentarios}" paginator="true"
					rows="12" paginatorPosition="bottom" paginatorAlwaysVisible="true"
					tableStyleClass="tableListagem" 
					emptyMessage="#{locale['crud.pesquisa.lista.semResultado']}">

					<p:column sortBy="#{registro.data}">

						<f:facet name="header">
							<h:outputText
								value="#{locale['blog.comentario.data']}" />
						</f:facet>
						<h:panelGroup layout="block" style=" width: 120px;">
							<h:outputText value="#{registro.data}" escape="false">
							<f:convertDateTime type="date" pattern="dd-MM-yyyy hh:mm"/>
							</h:outputText>
						</h:panelGroup>

					</p:column>

					<p:column sortBy="#{registro.texto}">

						<f:facet name="header">
							<h:outputText style="padding: 0px 10px 0px 10px;"
								value="#{locale['blog.label.titulo']}" />
						</f:facet>
						<h:panelGroup layout="block" style=" width: 250px;">
							<h:outputText value="#{registro.texto}" />
						</h:panelGroup>

					</p:column>


				</p:dataTable>

			</h:form>
		</p:panel>

	</h:panelGrid>

</ui:composition>